
	function ajaxFunction(){
		var ajaxRequest;  // The variable that makes Ajax possible!
		
		try{
			// Opera 8.0+, Firefox, Safari
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// Internet Explorer Browsers
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// Something went wrong
					alert("Your browser broke!");
					return false;
				}
			}
		}
		// Create a function that will receive data sent from the server
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4){
				var ajaxDisplay = document.getElementById(\'formcontent\');
				ajaxDisplay.innerHTML = ajaxRequest.responseText;
				
				// Refresh the page is login is successful
				if(ajaxRequest.responseText == ""){
					window.location = "'.$addr.'/org";
				}
			}
		}
		var username = document.getElementById(\'username\').value;
		var password = document.getElementById(\'password\').value;
		var queryString = "?username=" + username + "&password=" + password;
		ajaxRequest.open("GET", "login_ajax.php" + queryString, true);
		ajaxRequest.send(null); 
	}
	
	function enterKeyPress(e){
		var keycode;
		
		if (window.event) keycode = window.event.keycode;
		else if (e) keycode = e.which;
		
		if (keycode==13) {
			ajaxFunction();
		}
	}